// 通用样式

// 清除浮动
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

// 文本省略
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-ellipsis-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.text-ellipsis-3 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

// 隐藏元素
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

// 页面加载动画
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0052d9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

// 卡片样式
.card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 10px 0 #0000000a, 0 4px 5px 0 #00000014, 0 2px 4px -1px #0000001f;
  padding: 24px;
  margin-bottom: 24px;
}

// 按钮组
.btn-group {
  display: flex;
  gap: 8px;
  
  .t-button + .t-button {
    margin-left: 0;
  }
}

// 表单样式
.form-item-required {
  .t-form__label::before {
    content: '*';
    color: #d54941;
    margin-right: 4px;
  }
}

// 状态标签
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  
  &.success {
    background-color: #f0f9ff;
    color: #00a870;
    border: 1px solid #b3e5d1;
  }
  
  &.warning {
    background-color: #fff7e6;
    color: #ed7b2f;
    border: 1px solid #f4d5b7;
  }
  
  &.error {
    background-color: #fff2f0;
    color: #d54941;
    border: 1px solid #f5b2b2;
  }
  
  &.info {
    background-color: #f0f9ff;
    color: #0594fa;
    border: 1px solid #b3d9ff;
  }
}

// 空状态
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #00000040;
  
  .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
  }
  
  .empty-text {
    font-size: 14px;
    margin-bottom: 16px;
  }
}
